home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 2
/
PC World Interactive 2 - Eylül 1997.iso
/
shar
/
ofis
/
allma.exe
/
DROPCAP.SMM
< prev
next >
Wrap
INI File
|
1993-10-27
|
11KB
|
624 lines
[ver]
4
[sty]
_macro.sty
[files]
[charset]
82
ANSI (Windows, IBM CP 1252)
[revisions]
0
[prn]
Canon Bubble-Jet BJ-10e
[port]
FILE:
[lang]
18
[desc]
Create a drop cap
751784769
30
717547426
862
2
26
161
0
3
0
[fopts]
0
1
0
0
[lnopts]
2
Body Text
1
[docopts]
5
2
[GramStyle]
[ParaNum]
1
[tag]
Body Text
2
[fnt]
Courier
200
0
32768
[algn]
1
3
0
0
960
[spc]
17
212
4
0
0
4
100
[brk]
0
[line]
8
0
1
0
1
1
1
10
10
1
[spec]
0
0
0
1
1
0
0
0
0
[nfmt]
280
1
2
.
,
$
Body Text
0
0
[lay]
Standard
516
[rght]
16834
11907
2
960
960
3
1440
960
2
1
0
1
0
2
1
960
10947
20
1
480
1
960
1
1440
1
1923
1
2404
1
2880
1
3360
1
3845
1
4320
1
4800
1
5287
1
5760
1
6240
1
6713
1
7200
1
7680
1
8155
1
8640
1
9360
1
10080
[hrght]
[lyfrm]
1
11200
0
0
11907
1440
0
1
3
1 0 0 0 0 0 0
0
0
1
[frmlay]
1440
11907
1
1440
0
3
480
1440
0
1
0
1
1
0
1
1440
10465
0
[txt]
@Header@DROPCAP.SMM - Create a Drop Cap<**>By: Nick Payne </V> <:da<*$><* >>
>
[frght]
[lyfrm]
1
13248
0
15874
11907
16834
0
1
3
1 0 0 0 0 0 0
0
0
2
[frmlay]
16834
11907
1
1440
357
2
16044
1440
0
1
0
1
1
0
1
1440
10465
0
[txt]
<+B><:P10,0,>
>
[elay]
[l1]
0
[pg]
2
49 0 75 0 0 1 0 65535 2 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
92 0 47 1025 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
[edoc]
<:#280,9987><:f240,2TimesNewRomanPS,><*:>' This macro changes the first character of the current paragraph to a drop cap.
<:#280,9987><:f240,2TimesNewRomanPS,>' The insertion point can be anywhere in the paragraph.
<:#280,9987><:f240,2TimesNewRomanPS,>' The default height for the drop cap is three lines. If you want to change this,
<:#280,9987><:f240,2TimesNewRomanPS,>' change the value of the constant NUM_LINES
<:#280,9987><:f240,2TimesNewRomanPS,>
@Function@<:#280,9987><:f240,2TimesNewRomanPS,>' give symbolic names to constants
<:#280,9987><:f240,2TimesNewRomanPS,>define NUM_LINES 3 ' # lines drop cap occupies
<:#280,9987><:f240,2TimesNewRomanPS,>
@Function@<:#280,9987><:f240,2TimesNewRomanPS,>Function AddToMenu()
@Subhead@<:#280,9987><:f240,2TimesNewRomanPS,>rmac = GetRunningMacroFile$()
@Subhead@<:#280,9987><:f240,2TimesNewRomanPS,>StatusBarMsg("Installing DropCap on the Edit / Insert cascading menu")
@Subhead@<:#280,9987><:f240,2TimesNewRomanPS,>DeleteMenuItem(1, "&Edit" "&Insert", "Drop &Cap")
@Subhead@<:#560,9987><:f240,2TimesNewRomanPS,>InsertCascadeMenuItem(1, "&Edit", "&Insert", 1, "Drop &Cap" , "{rmac}!dropcap", "Convert first character of current paragraph to a Drop Cap.")
@Subhead@<:#280,9987><:f240,2TimesNewRomanPS,>StatusBarMsg("")
@End Function@<:#280,9987><:f240,2TimesNewRomanPS,>end function
@Function@<:#280,9987><:f240,2TimesNewRomanPS,>
@Function@<:#280,9987><:f240,2TimesNewRomanPS,>Function DropCap()
<:#280,9987><:f240,2TimesNewRomanPS,>' SingleStep(1)
<:#280,9987><:f240,2TimesNewRomanPS,>' must be in layout mode to get the cursor position
<:#280,9987><:f240,2TimesNewRomanPS,>mode = GetMode() ' what mode is the screen in?
<:#280,9987><:f240,2TimesNewRomanPS,>IF mode != 1
<:#280,9987><:f240,2TimesNewRomanPS,>LayoutMode() ' if not layout mode, make it so
<:#280,9987><:f240,2TimesNewRomanPS,>ENDIF
<:#280,9987><:f240,2TimesNewRomanPS,>
<:#280,9987><:f240,2TimesNewRomanPS,>Type("<[>Home]<[>Right]<[>CTRLDown]<[>CTRLUp]") ' go to start of para
<:#280,9987><:f240,2TimesNewRomanPS,>
<:#280,9987><:f240,2TimesNewRomanPS,>' test that first character is alphabetic
<:#280,9987><:f240,2TimesNewRomanPS,>ucLow = ASC("A")
<:#280,9987><:f240,2TimesNewRomanPS,>ucHigh = ASC("Z")
<:#280,9987><:f240,2TimesNewRomanPS,>lcLow = ASC("a")
<:#280,9987><:f240,2TimesNewRomanPS,>lcHigh = ASC("z")
<:#280,9987><:f240,2TimesNewRomanPS,>charNum = ASC(CurChar$())
<:#560,9987><:f240,2TimesNewRomanPS,>IF (charNum <;>= ucLow AND charNum <<= ucHigh) OR (charNum <;>= lcLow AND charNum <<= lcHigh)
<:#280,9987><:f240,2TimesNewRomanPS,> ' get cursor position (Y coordinates are negative)
<:#280,9987><:f240,2TimesNewRomanPS,> position = CursorPosition$() ' get cursor pos, in twips
<:#280,9987><:f240,2TimesNewRomanPS,> paraX = strfield$(position, 1, ",") ' parse out X coord
<:#280,9987><:f240,2TimesNewRomanPS,> paraY = strfield$(position, 2, ",") ' parse out Y coord
<:#280,9987><:f240,2TimesNewRomanPS,>
<:#280,9987><:f240,2TimesNewRomanPS,> ' now find line height
<:#280,9987><:f240,2TimesNewRomanPS,> Type("<[>Down]") ' down a line
<:#280,9987><:f240,2TimesNewRomanPS,> position = CursorPosition$()
<:#280,9987><:f240,2TimesNewRomanPS,> Type("<[>Up]") ' return to para start
<:#280,9987><:f240,2TimesNewRomanPS,> lineHeight = paraY - strfield$(position, 2, ",")
<:#280,9987><:f240,2TimesNewRomanPS,> IF lineHeight << 0 ' we've gone to next page
<:#280,9987><:f240,2TimesNewRomanPS,> Message("Unable to place a Drop Cap at this point on the page")
<:#280,9987><:f240,2TimesNewRomanPS,> Exit Function
<:#280,9987><:f240,2TimesNewRomanPS,> ENDIF
<:#280,9987><:f240,2TimesNewRomanPS,>
<:#280,9987><:f240,2TimesNewRomanPS,> dropCapPointSize = lineHeight * NUM_LINES * 5 / 80
<:#280,9987><:f240,2TimesNewRomanPS,> Type("<[>SHIFTRight]") ' select first char
<:#280,9987><:f240,2TimesNewRomanPS,> FontPointSizeChange(dropCapPointSize) ' make it big
<:#280,9987><:f240,2TimesNewRomanPS,> IF (charNum <;>= lcLow AND charNum <<= lcHigh)
<:#280,9987><:f240,2TimesNewRomanPS,> UpperCase() ' ensure char is upper case
<:#280,9987><:f240,2TimesNewRomanPS,> ENDIF
<:#280,9987><:f240,2TimesNewRomanPS,> ' the following apparently aimless line is needed because Ami Pro was not
<:#280,9987><:f240,2TimesNewRomanPS,> ' returning the cursor position while the text was selected
<:#280,9987><:f240,2TimesNewRomanPS,> Type("<[>Left]<[>Right]")
<:#280,9987><:f240,2TimesNewRomanPS,> position = CursorPosition$() ' get cursor pos, in twips
<:#280,9987><:f240,2TimesNewRomanPS,> frameX = strfield$(position, 1, ",") ' calculate character width
<:#280,9987><:f240,2TimesNewRomanPS,> ' next line slightly increases the frame width or char doesn't display in frame
<:#280,9987><:f240,2TimesNewRomanPS,> frameX = frameX + frameX / 50
<:#280,9987><:f240,2TimesNewRomanPS,> frameY = paraY - lineHeight * NUM_LINES ' and height
<:#280,9987><:f240,2TimesNewRomanPS,> Type("<[>SHIFTLeft]") ' select character
<:#280,9987><:f240,2TimesNewRomanPS,> Cut() ' and cut it to clipboard
<:#280,9987><:f240,2TimesNewRomanPS,>
<:#280,9987><:f240,2TimesNewRomanPS,> AddFrame(paraX, paraY, frameX, frameY) ' add the frame
<:#280,9987><:f240,2TimesNewRomanPS,> ' now ensure the frame is correct type, has no border, etc.
<:#280,9987><:f240,2TimesNewRomanPS,> FrameModInit()
<:#280,9987><:f240,2TimesNewRomanPS,> FrameModLines(0, 1, 1, 0, 16777215, 0, 0, 0, 0, 0)
<:#280,9987><:f240,2TimesNewRomanPS,> FrameModType(704, 0, "")
<:#280,9987><:f240,2TimesNewRomanPS,> FrameModBorders(frameX-ParaX, paraY-frameY, 0-paraY, paraX, 0, 0, 0, 0, 3)
<:#280,9987><:f240,2TimesNewRomanPS,> FrameModColumns(0, 2, 0, 1, 0, frameX-ParaX, 0)
<:#280,9987><:f240,2TimesNewRomanPS,> FrameModFinish()
<:#280,9987><:f240,2TimesNewRomanPS,> Type("<[>Enter]") ' prepare to insert char in frame
<:#280,9987><:f240,2TimesNewRomanPS,> Paste() ' paste it back from clipboard
<:I0,0,0,0><:S+200><:#200,9987><:f240,2TimesNewRomanPS,>
<:#280,9987><:f240,2TimesNewRomanPS,> Indent(0, 0, 0, 0) ' ensure no indentation on drop cap
<:#280,9987><:f240,2TimesNewRomanPS,> Spacing(dropCapPointSize * 20 * 80 / 100) ' reduce line spacing
<:#280,9987><:f240,2TimesNewRomanPS,> Type("<[>SHIFTLeft]") ' select drop cap character
<:#280,9987><:f240,2TimesNewRomanPS,> FontPointSizeChange(dropCapPointSize + 1) ' make it fit better
<:#280,9987><:f240,2TimesNewRomanPS,>ELSE
<:#280,9987><:f240,2TimesNewRomanPS,> message("First character of paragraph not alphabetic")
<:#280,9987><:f240,2TimesNewRomanPS,>ENDIF
<:#280,9987><:f240,2TimesNewRomanPS,>
<:#280,9987><:f240,2TimesNewRomanPS,>' return to previous mode if necessary
<:#280,9987><:f240,2TimesNewRomanPS,>IF mode = 48
<:#280,9987><:f240,2TimesNewRomanPS,> OutlineMode()
<:#280,9987><:f240,2TimesNewRomanPS,>ELSEIF mode = 16
<:#280,9987><:f240,2TimesNewRomanPS,> DraftMode()
<:#280,9987><:f240,2TimesNewRomanPS,>ENDIF
<:f240,2TimesNewRomanPS,>Type( "<[>Esc]<[>Esc]<[>Esc]<[>Right]<[>Left]<:f><[>CTRLDown]<:f240,2TimesNewRomanPS,><:f><:f240,2TimesNewRomanPS,>" )
@End Function@<:#280,9987><:f240,2TimesNewRomanPS,>END FUNCTION<:f240,,><:f>
>
[Embedded]
00009355
>
[macsum] 2
AddToMenu 0 0 2 8
DropCap 272 0 14 16
[macse]
14 AddToMenu
0 802
13
8 1
0 789 "Installing DropCap on the Edit / Insert cascading menu"
0 520 1 "&Edit" "&Insert" "Drop &Cap"
0 529 1 "&Edit" "&Insert" 1 "Drop &Cap" "{1}!dropcap" "Convert first character of current paragraph to a Drop Cap."
0 789 ""
6 0
15
9
14 DropCap
0 29
13
8 1
6 1
5 1
18 1
11 00000065
2 210 1
0 6 "[36][39][16424][16422]"
0 40 "A"
13
8 2
0 40 "Z"
13
8 3
0 40 "a"
13
8 4
0 40 "z"
13
8 5
0 282
13
0 40 [X]
13
8 6
6 6
6 2
18 2
6 6
6 3
18 4
1 1
6 6
6 4
18 2
6 6
6 5
18 4
1 1
1 2
11 00001203
0 293
13
8 7
0 20 "{7}" 1 ","
13
8 8
0 20 "{7}" 2 ","
13
8 9
0 6 "[40]"
0 293
13
8 7
0 6 "[38]"
6 9
0 20 "{7}" 2 ","
13
3 1
8 10
6 10
5 0
18 5
11 00000543
0 3 "Unable to place a Drop Cap at this point on the page"
6 0
15
9
6 10
5 3
4 0
5 5
4 0
5 80
4 1
8 11
0 6 "[4135]"
2 279 1 "{11}"
6 6
6 4
18 2
6 6
6 5
18 4
1 1
11 00000675
2 273 1
0 6 "[37][39]"
0 293
13
8 7
0 20 "{7}" 1 ","
13
8 12
6 12
6 12
5 50
4 1
3 0
8 12
6 9
6 10
5 3
4 0
3 1
8 13
0 6 "[4133]"
2 153 1
2 413 1 "{8}" "{9}" "{12}" "{13}"
2 421 1
2 416 1 0 1 1 0 16777215 0 0 0 0 0
2 417 1 704 0 ""
6 12
6 8
3 1
6 9
6 13
3 1
5 0
6 9
3 1
2 418 1 [X] [X] [X] "{8}" 0 0 0 0 3
6 12
6 8
3 1
2 419 1 0 2 0 1 0 [X] 0
2 420 1
0 6 "[13]"
2 155 1
2 265 1 0 0 0 0
6 11
5 20
4 0
5 80
4 0
5 100
4 1
2 252 1 [X]
0 6 "[4133]"
6 11
5 1
3 0
2 279 1 [X]
10 00001254
0 3 "First character of paragraph not alphabetic"
6 1
5 48
18 0
11 00001306
2 218 1
10 00001345
6 1
5 16
18 0
11 00001345
2 211 1
0 6 "[27][27][27][39][37][16424]"
6 0
15
9
00009380